<template>
  <!-- 首页入口（分类+广告）-->
  <div class="container">
    <div class="home-entry">
      <!-- 左侧分类 -->
      <HomeCategory />
      <!-- 轮播图 -->
      <HomeBanner />
    </div>
  </div>
  <!-- 新鲜好物 -->
  <HomeNew />
  <!-- 人气推荐 -->
  <HomeHot />
  <!-- 使用transition组件 -->
  <!-- <button @click="show=true">显示|创建</button>
  <button @click="show=false">隐藏|移除</button>
  <Transition >
    <div v-show="show" style="width:100px;height:100px;background:red"></div>
  </Transition>
  <Transition  name="h">
    <div v-show="show" style="background:red"></div>
  </Transition> -->
  <!-- 热门品牌 -->
  <HomeBrand />
  <!-- 商品区域 -->
  <HomeProduct />
  <!-- 最新专题 -->
  <HomeSpecial />
</template>
<script>
import HomeCategory from './components/home-categroy.vue'
import HomeBanner from './components/home-banner.vue'
import HomeNew from './components/home-new.vue'
import HomeHot from './components/home-hot.vue'
import HomeBrand from './components/home-brand.vue'
import HomeProduct from './components/home-product.vue'
import HomeSpecial from './components/home-special.vue'
import { ref } from 'vue'
export default {
  name: 'HomePage',
  components: {
    HomeCategory,
    HomeBanner,
    HomeNew,
    HomeHot,
    HomeBrand,
    HomeProduct,
    HomeSpecial
  },
  setup () {
    const show = ref(true)
    return { show }
  }
}
</script>
<style lang="less" scoped>
// 如果需要多组动画，transition加上name属性
// 其他6个类型写法 xxx-enter-from xxx-enter-active xxx-enter-to
// -------------- xxx-leave-from xxx-leave-active xxx-leave-to
// 进入 vue2.0  v-enter v-enter-active v-enter-to
// 进入 vue3.0  v-enter-from v-enter-active v-enter-to
.v-enter-from{
  opacity: 0;
}
.v-enter-active{
  transition:all 2s;
}
.v-enter-to{
  opacity: 1;
}
// 离开 vue2.0 v-leave v-leave-active v-leave-to
// 离开 vue3.0 v-leave-from v-leave-active v-leave-to
.v-leave-from{
  opacity: 1;
}
.v-leave-active{
  transition:all 2s;
}
.v-leave-to{
  opacity: 0;
}
// h的动画
.h-enter-from{
  height: 0px;
}
.h-enter-active{
  transition:all 2s;
}
.h-enter-to{
  height: 100px;
}
.h-leave-from{
  height: 100px;
}
.h-leave-active{
  transition:all 2s;
}
.h-leave-to{
  height: 0px;
}
</style>
